<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	PGMOBILE :: Configura tus Alertas
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Mis Alertas</h2>
    <p>
        Abajo se muestra la lista de las alertas configuradas. <%= Html.ActionLink("Agregar nueva alerta", "NuevaAlerta", "Alarmas") %>
    </p>
    <table border="0" cellpadding="0" class="data-table" cellspacing="0" width="100%">
        <caption>Mis Alarmas</caption>
      <% Html.Repeater<Pgmobile.GestionAlarmasProxy.Alerta>("Alarmas", "row", "row-alternating", (alarma, css) =>
     { %>
      <tr class="<%= css %>">
        <td><%= alarma.IdAlerta.ToString() %></td>
        <td><%= alarma.IdParada.ToString() %></td>
        <td><%= alarma.IdLinea.ToString() %></td>
        <td><%= alarma.Minutos.ToString() %></td>
        <td><%= alarma.Hora.ToString() %></td>
        <td>
            <% alarma.Dias.ForEach((dia) =>
               { %>
                <%= (alarma.Dias.ElementAt(0).Equals(dia) ? "" : "-") + dia%>
            <%       
                });
            %>
        </td>
        <td><%= Html.ActionLink("Editar", "EditarAlerta", new { id = alarma.IdAlerta.ToString() })%></td>
        <td><%= Html.ActionLink("Eliminar", "BorrarAlerta", new { id = alarma.IdAlerta.ToString() })%></td>
      </tr>
      <% }); %>
    </table>

</asp:Content>
